!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="dc5734e0-6850-4f1f-944f-be277a679463",e._sentryDebugIdIdentifier="sentry-dbid-dc5734e0-6850-4f1f-944f-be277a679463")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1821],{30948:function(e,t,n){n.d(t,{c:function(){return r}});let r=119092513},90715:function(e,t,n){n.d(t,{n:function(){return o}});var r=n(67651);let o=e=>{let{authorId:t,isEditableInMockup:n=!1,isEditableInWepik:o=!1,type:i}=e;return!(0,r.h)(t)&&!n&&!o&&["photo","vector","psd"].includes(i)}},93357:function(e,t,n){n.d(t,{l:function(){return o},_:function(){return p}});var r=n(52983);let o=(0,r.createContext)({});var i=n(97458),u=n(51780),l=n(5298),c=n(90715);let a=()=>{try{let e=sessionStorage.getItem("forceShowAttributionWindow");if(!e)return!1;return"1"===e}catch(e){return!1}};var s=n(67651);let d=(e,t,n,r)=>!(e||t||n)&&("photo"===r||"vector"===r),p=e=>{let{children:t,disabledAttribution:n=!1,...p}=e,[f,h]=(0,r.useState)(!1),{query:v}=(0,u.useRouter)(),{type:m,isEditableInMockup:g=!1,isEditableInWepik:y=!1,isEditableInStoryset:k=!1,author:b}=p,_=(0,c.n)({type:m,isEditableInMockup:g,isEditableInWepik:y,authorId:b.id}),E=(0,s.h)(b.id),I=!E,w=I&&d(k,y,g,m),A=(0,r.useMemo)(()=>{var e,t,r,o,i,u,l,c;return{showingAttribution:f,showAttribution:()=>!n&&h(!0),hideAttribution:()=>h(!1),isAiToolsEnabled:_,isOnlyEditableResource:E,isDownloadableResource:I,isUsableInMockup:w,...p,isCrossSellEnabled:!!(null===(t=p.relatedResources)||void 0===t?void 0:null===(e=t.relatedPhotos)||void 0===e?void 0:e.length)||!!(null===(o=p.relatedResources)||void 0===o?void 0:null===(r=o.relatedVideos)||void 0===r?void 0:r.length)||!!(null===(u=p.relatedResources)||void 0===u?void 0:null===(i=u.relatedVectors)||void 0===i?void 0:i.length)||!!(null===(c=p.relatedResources)||void 0===c?void 0:null===(l=c.relatedPsds)||void 0===l?void 0:l.length)}},[f,_,E,I,w,p,n]);return(0,r.useEffect)(()=>{a()&&v["log-in"]?h(!0):h(!1)},[v]),(0,i.jsx)(o.Provider,{value:A,children:(0,i.jsx)(l.t,{resourceId:p.id,children:t})})}},7526:function(e,t,n){n.d(t,{AD:function(){return s},Iq:function(){return d},J5:function(){return r},KK:function(){return l},MU:function(){return p},QN:function(){return a},Xj:function(){return c},a5:function(){return i},en:function(){return u},mj:function(){return f},w8:function(){return o}});let r={ai:"photos",photo:"photos",vector:"vectors",psd:"psd",icon:"icons",template:"templates",mockup:"mockups"},o={sm:"small",md:"medium",lg:"large"},i=50,u=["psd","vector","photo","template","mockup","illustration"],l="/designer/edit/api/redirector/",c="1,2,3,4,5,23,24,25,26,28,29,30,31,33,34,35,39,43,52",a="remove_background_edit",s="remove_background_edit_mockup",d="/mockup-editor/?&sku=",p="16,17,18,19,27,50,53,54",f=179396276},67651:function(e,t,n){n.d(t,{h:function(){return i}});var r=n(30948),o=n(7526);let i=e=>[o.mj,r.c].includes(e)},49737:function(e,t,n){n.d(t,{rW:function(){return r.r},ph:function(){return o.p},tc:function(){return l},Dt:function(){return s},hv:function(){return d.h},fg:function(){return p.f},Zh:function(){return m},m6:function(){return g.m}});var r=n(19382),o=n(6583),i=n(52983),u=n(93357);let l=()=>{let{showingAttribution:e,showAttribution:t,hideAttribution:n}=(0,i.useContext)(u.l);return{showingAttribution:e,showAttribution:t,hideAttribution:n}};var c=n(7616),a=n(18547);let s=e=>(0,c.Dv)((0,a.a)(e));var d=n(71597);n(52873),n(13745),n(55287),n(18444),n(91394),n(87420);var p=n(11011),f=n(45591),h=n(44932),v=n(26140);let m=e=>{let{itemId:t,isModal:n,previewUrlParams:r}=e,o=(0,f.oL)(),i=(0,v.Q)(),u=(0,c.b9)(h.G4);return e=>{e.shiftKey||e.ctrlKey||e.altKey||!n||!i||(u(null!=r?r:null),o(t,i.items,"regular"))}};var g=n(55858)},19382:function(e,t,n){n.d(t,{r:function(){return i}});var r=n(52983),o=n(6583);let i=()=>{let{fileTypes:e}=(0,o.p)();return(0,r.useMemo)(()=>{let t=[];return e&&Object.keys(e).forEach(n=>{var r,o;null===(o=e[n])||void 0===o||null===(r=o.items)||void 0===r||r.forEach(r=>{var o;return t.push({format:n,total:Number(null===(o=e[n])||void 0===o?void 0:o.total),...r})})}),t},[e])}},6583:function(e,t,n){n.d(t,{p:function(){return i}});var r=n(52983),o=n(93357);let i=()=>(0,r.useContext)(o.l)},71597:function(e,t,n){n.d(t,{h:function(){return l}});var r=n(52983),o=n(6583);let i={photo:"Photo",vector:"Vector",psd:"PSD",ai:"AI Image",icon:"Icon",template:"Template",mockup:"Mockup"},u={photo:"photos",vector:"vectors",psd:"psd",ai:"ai_images",icon:"icons",template:"vectors_templates",mockup:"psds_mockups"},l=e=>{let{regularType:t,isAIGenerated:n,isEditableInMockup:l,isEditableInWepik:c}=(0,o.p)();return(0,r.useMemo)(()=>{let r=null!=t?t:null==e?void 0:e.type;return(n||(null==e?void 0:e.isAIGenerated))&&(r="ai"),(l||(null==e?void 0:e.isEditableInMockup))&&(r="mockup"),(c||(null==e?void 0:e.isEditableInWepik))&&(r="template"),{contentGroup:u[r],contentTitle:i[r]}},[t,e,n,l,c])}},11011:function(e,t,n){n.d(t,{f:function(){return l}});var r=n(52983),o=n(6583);let i={sm:.5,md:.75,lg:1},u=e=>{let{width:t,height:n}=e;return t>n?{width:2e3,height:2e3/(t/n)}:{width:2e3/(n/t),height:2e3}},l=e=>{let{dimensions:{width:t,height:n}}=(0,o.p)();return(0,r.useMemo)(()=>{if("original"===e)return{width:t,height:n};let r=u({width:t,height:n});return{width:Math.round(r.width*i[e]),height:Math.round(r.height*i[e])}},[n,e,t])}},55858:function(e,t,n){n.d(t,{m:function(){return u}});var r=n(8147);let o=()=>{var e;let t=(0,r.H)();return null==t?void 0:null===(e=t.permissions)||void 0===e?void 0:e.canEditMockups},i=()=>{var e;let t=(0,r.H)();return null==t?void 0:null===(e=t.permissions)||void 0===e?void 0:e.canEditTemplates},u=e=>{let t=o(),n=i();return!e||!!(t||n)}},61821:function(e,t,n){n.d(t,{AD:function(){return r.AD},Dt:function(){return o.Dt},KK:function(){return r.KK},Zh:function(){return o.Zh},_D:function(){return u._},a5:function(){return r.a5},en:function(){return r.en},fg:function(){return o.fg},hv:function(){return o.hv},ph:function(){return o.ph},rW:function(){return o.rW},tc:function(){return i.t}});var r=n(7526),o=n(49737),i=n(77604),u=n(93357);n(56879)},77604:function(e,t,n){n.d(t,{t:function(){return b}});var r=n(32950),o=n(62317),i=n(7526);let u=e=>Array.isArray(e),l=["locale","sort","page","term","slug","img"],c=["category","peopleRange","style"],a=["color","license","type","author"],s=["hasPrompt","quickEdit","freepikChoice"],d=["tool","orientation","fileType","peopleAge","peopleGender","peopleEthnicity"],p=["format"],f={sort:"order",type:"content_type",people:"filters[people]",peopleRange:"filters[people][number]",style:"filters[vector][style]",hasPrompt:"[ai-generated][has_prompt]",quickEdit:"[quick-edit]",freepikChoice:"[choice]",aiGenerated:"filters[ai-generated]",tool:"[ai-generated][tool]",orientation:"[orientation]",fileType:"[vector][type]",peopleAge:"[people][age]",peopleGender:"[people][gender]",peopleEthnicity:"[people][ethnicity]"},h={fileType:{vector:o.qQ,illustration:o.qQ,psd:o.bJ,photo:o.RU}},v=e=>f[e]||e,m=(e,t)=>p.includes(e)?"":"term"===e?"".concat(e,"=").concat(encodeURIComponent(t.toString())):e===r.FILTERS_NAMES.fromQuery?"enable-next-search=0":l.includes(e)||c.includes(e)?"".concat(v(e),"=").concat(t):a.includes(e)?"mockup"==t?"filters[".concat(v(e),"]=psd&filters[production-lines]=").concat(i.MU):"template"==t?"filters[".concat(v(e),"]=template&filters[production-lines]=").concat(i.Xj):"filters[".concat(v(e),"]=").concat(t):s.includes(e)?"filters".concat(v(e),"=1"):"".concat(v(e),"[").concat(t,"]=1"),g=(e,t,n)=>{e[n]=e[n]?"".concat(e[n],",").concat(t):t},y=(e,t,n)=>{let r=t[e];return r?"fileType"===e?k(r,n):["filters".concat(v(e),"=").concat(r)]:[]},k=(e,t)=>{var n;let r=null===(n=t.find(e=>e.includes("content_type")))||void 0===n?void 0:n.split("=")[1],o=[],i=e.split(","),u=h.fileType;return Object.keys(u).filter(e=>!r||e===r).forEach(e=>{let t=u[e],n=i.filter(e=>t.includes(e));n.length>0&&o.push("filters[".concat(e,"][type]=").concat(n.join(",")))}),o},b=function(){for(var e=arguments.length,t=Array(e),n=0;n{u(e)?e.forEach(e=>{let[t,n]=e;d.includes(t)?g(o,n,t):(null==n?void 0:n.length)>0&&r.push(m(t,n))}):"string"==typeof e?r.concat(e.split("&")):Object.entries(e).forEach(e=>{let[t,n]=e;("number"==typeof n||n.length>0)&&r.push(m(t,n))})});let i=d.map(e=>y(e,o,r)).flat(),l=Array.from(new Set([...r,...i])).sort((e,t)=>e.localeCompare(t)).join("&");return l.startsWith("&")?l.slice(1):l}}}]);